package com.bky.agent.proxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * @Author shipeilei
 * @Date Created on 2018/5/13
 */
public class TrainStationHandler implements InvocationHandler{
    private Object obj;

    public TrainStationHandler(Object obj) {
        this.obj = obj;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("欢迎光临!");
        Object result = method.invoke(obj, args);
        System.out.println("请交手续费!");
        return result;
    }
}
